package cn.zf233.jwtshiro.exception;

import cn.zf233.jwtshiro.common.R;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by zf233 on 2021/7/12
 */
@ControllerAdvice
public class ExceptionHandleOfPublic {

    @ResponseBody
    @ExceptionHandler(RuntimeException.class)
    public R<String> doException(Exception e) {
        return R.createByErrorMessage(e.getMessage());
    }
}
